package bairui.international.console.web.controller.barter.category.product;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.lianjing.sh.project.commons.util.Util_FileDeal;
import com.lianjing.sh.spring.web.controller.base.action.Action;

import bairui.international.model.domain.jpa.TB_ProductRollImage;
import bairui.international.service.Service_ProductRollImage;

/**
 *
 * 产品滚动图片管理
 *
 * @generated
 * 
 * @see STest_C_Barter_Category_ProductRollUpload_ShowImg 测试
 *
 */
@Controller
public class C_Barter_Category_ProductRollUpload_ShowImg
 extends SC_Barter_Category_ProductRollUpload_ShowImg 
{
	
	@Autowired private Service_ProductRollImage service_ProductRollImage;
	
	/**
	 * 显示
	 */
	@Action(ShowImg.class)
	@GetMapping(value=ShowImg.RequestMappingValue)
	public void showImg(
		HttpServletRequest request,
		HttpServletResponse response, 
		@PathVariable(name=ShowImg.PathVariableName.CategoryId) long categoryId, 
		@PathVariable(name=ShowImg.PathVariableName.Id) long id, 
		@PathVariable(name=ShowImg.PathVariableName.ImgId) long imgId
	) throws Exception {
		TB_ProductRollImage bean = service_ProductRollImage.findById(imgId);
		if(null != bean){
			Util_FileDeal.getImg(response, pathConfig.getPosition_Image_ProductRollImage()+bean.getFileUrl());
		}
	}
	

}
